package com.example.datn.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.datn.R;
import com.example.datn.utils.Variables;


public class PaPerAdapter extends ArrayAdapter<String> {
	private Context context;
	private String[] paper; 
	
	public PaPerAdapter(Context context,  int ivIcon,
			String[] paper) {
		super(context, ivIcon, paper);
this.context=context;
this.paper=paper;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater=(LayoutInflater)context.getSystemService(context.LAYOUT_INFLATER_SERVICE);

View rowView=inflater.inflate(R.layout.tintuc_rss, parent,false);
ImageView iv=(ImageView) rowView.findViewById(R.id.ivicon);
TextView tv=(TextView) rowView.findViewById(R.id.tvPaper);
		

iv.setImageResource(Variables.ICONS[position]);
tv.setText(paper[position]);

return rowView;
	}

	
	
}

